<?php 
	$auth = new AuthModel();
	$user_type = $auth->getUserInfo('type');	

	$message = $this->message;
	$order_detail = $this->order_detail;
?>
<script	 type="text/javascript" src="/js/jquery.validate.js"></script> 

<section class="grid_12" style="width: 60%;margin-left: 20%;">
	<div class="block-border" style="margin-bottom: 20px;">
	       <form class="block-content form" id="add_form" method="post" action="">
				
				<h1>予約キャンセル</h1>
				
				<fieldset>
					<legend>予約情報</legend>
					<?php echo $this->formHidden("order_id", $this->id)?>

					<!-- Message display -->
					<?php if($message):?>
					<ul class="message no-margin">
						<li><?php echo $message?>aaaaa</li>
					</ul>
					<?php endif;?>

					<p class="inline-label" style="clear: both;">
						<label>予約コード</label>
						<span><?php echo $order_detail["id"]?></span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label>会議室</label>
						<span><?php echo $order_detail["code"]?></span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label>席の数</label>
						<span><?php echo $order_detail["number_seat"]?> 席</span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label>単価</label>
						<span><?php echo $order_detail["rent_price"]?> VND</span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label>登録時間</label>
						<span><?php echo $order_detail["ordered_time"]?></span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label>予約時間</label>
						<span><?php echo $order_detail["start_time"] . " ~ " . $order_detail["end_time"]?></span>
					</p>
					
					<p class="inline-label" style="clear: both;">
						<label style="color:red">キャンセル手数料</label>
						<span style="color:red"><?php echo CANCEL_FEE?> VND</span>
					</p>
				</fieldset>

				<fieldset class="grey-bg no-margin">
					<p>
						<button type="submit">はい</button>
						<button type="button" id="cancel-btn">いえ</button>
					</p>
					<?php echo $this->formHidden("callback", $user_type == NORMAL_USER ? "/user/order/list-order" : "/admin/order/index")?>
				</fieldset>
				
			</form>
		</div>
</section>

<script type="text/javascript">
	$(document).ready(function(){
		$("#cancel-btn").click(function(){
			window.location = $("#callback").val();
		});
	});
</script>